NcApi
Introduction and overview

The application layer interfaces with the node through the API when payload data is being transmitted or received. The API implements handles for encoding/decoding and synchronisation of the data transfer to and from the node.

For further information, please also refer to the documents on NeoCortec's download page:
neocortec.com/downloads/

Overview of the API context

The Application using the API typically resides in a microcontroller which communicates with the NeoCortec node through a UART.

ApiContext.png
API context

Interface between the API and the Tx part of the Application

Functions for initiating a message to the NeoCortec module by enqueueing it for transmission:

msc_inline_mscgraph_2

Unfortunately the links in the sequence diagram does not work in the PDF version of the documentation, and hence links to the functions are provided here:

Interface between the API and the Tx part of the API Support

Functions related to the actual transmission of a message to the NeoCortec module as response to the CTS signal:

msc_inline_mscgraph_3

NcApiSupportTxData() will be called if there is a pending enqueued message when NcApiCtsActive() is called.
Please also refer to the section "Interface between the API and the CTS part of the API Support".

Unfortunately the links in the sequence diagram does not work in the PDF version of the documentation, and hence links to the functions are provided here:

Interface between the API and the CTS part of the API Support

Function to inform the API that the NeoCortec module is ready to receive messages:

msc_inline_mscgraph_4

If there is a pending enqueued message the API will call NcApiSupportTxData(), and when the entire message has been delivered to the UART, NcApiSupportMessageWritten() is called.
Please also refer to the section "Interface between the API and the Tx part of the API Support".

Unfortunately the links in the sequence diagram does not work in the PDF version of the documentation, and hence links to the functions are provided here:

Interface between the API and the Rx part of the Application

When data is received from the mesh network, a series of call-back functions will call the Application with the received data. Depending on what type of data is received, a type specific call-back is issued. It is optional for the application layer to register for the call-backs.

Call back functions to pass on received messages to the application:

msc_inline_mscgraph_5

Unfortunately the links in the sequence diagram does not work in the PDF version of the documentation, and hence links to the functions are provided here:

Interface between the API and the Rx part of the API Support

Functions related to reception of messages from the NeoCortec module:

msc_inline_mscgraph_6

When data is received from the UART, it shall be forwarded to NcApiRxData(). When a complete message has been received, the application will be notified via NcApiSupportMessageReceived().

Unfortunately the links in the sequence diagram does not work in the PDF version of the documentation, and hence links to the functions are provided here: